﻿﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>无标题文档</title>
<script type="text/javascript" src="static/js/jquery.js"></script>
<link href="static/css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>
<script type="text/javascript">
$(function() {
	//jQuery提交  
	$("#del").click(function(){
		   if($("input[name='ids']:checked").length == 0){
			   alert("至少选择一个用户！");
			   return;
	}
		   var gnl=confirm("确定要删除?");
		   if (gnl==true){
			 $("#userDetailForm").submit(); 
		     return true;
		   }else{
		     return false;
		   }
	    // 
	}); 
});
</script>
<!-- 全选/全不选 -->
<script type="text/javascript">
   $(function() {
           $("#checkAll").click(function() {
                $('input[name="ids"]').attr("checked",this.checked); 
            });
            var $ids = $("input[name='ids']");
            $ids.click(function(){
                $("#checkAll").attr("checked",$ids.length == $("input[name='ids']:checked").length ? true : false);
            });
    });
 </script>
 <style type="text/css">  
 /*设置内容超出用省略号代替*/
 .tablelist {  
    table-layout: fixed;  
    width: 98% border:0px;  
    margin: 0px;  
} 
 .tablelist tr td {  
    text-overflow: ellipsis; /* for IE */  
    -moz-text-overflow: ellipsis; /* for Firefox,mozilla */  
    overflow: hidden;  
    white-space: nowrap;   
    text-align: left  
}  
 </style>


</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">数据表</a></li>
    <li><a href="#">基本内容</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li><a href="User_toAdd.action" target="rightFrame"><span><img src="static/images/t01.png" /></span>添加</a></li>
        <li><a id="del"><span><img src="static/images/t03.png" /></span>删除</a></li>
        </ul>
        <!-- javascript:document.roleDetailForm.submit(); -->
        
    </div>
    
    
    <form id="userDetailForm" name="userDetailForm" action="User_doBatchDelete.action" method="post">
    <table class="tablelist">
    	<thead>
    	<tr>
        <th style="width: 50px;"><input id="checkAll" name="" type="checkbox" value=""/></th>
        <th style="width: 80px;">编号<i class="sort"><img src="static/images/px.gif" /></i></th>
        <th style="width: 200px;">用户名</th>       
        <th style="width: 200px;">创建时间</th>
        <th style="width: 200px;">联系电话</th>
        <th style="width: 300px;">所属角色</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.datas}" var="user">
        <tr>
        <td><input name="ids" type="checkbox" value="${user.id}" /></td>
        <td>${user.id}</td>
        <td>${user.userName}</td>       
        <td>${user.createDate}</td>
        <td>${user.telephone}</td>
        
        <td>
        	<c:forEach items="${user.user_role}" var="role">
        		<c:out value="${role.roleDesc}"></c:out> &nbsp;&nbsp;
        	</c:forEach>
        </td>
        
        <td><a href="User_updatePrompt.action?user.userName=${user.userName}" class="tablelink">更新</a>     
       	</td>
        </tr> 
        </c:forEach>     
        </tbody>
    </table>
    </form>
        			<!-- 
    				==、eq、//相等
    			 	!=、ne、// 不相等
					<、lt、//小于
					>、gt、//大于
					<=、ge、//小于等于
					>=、le。//大于等于 
					
					<i> 标签显示斜体文本效果。
				-->
   
   
       <div class="pagin">
    	<div class="message">共<i class="blue">${page.total}</i>条记录，当前显示第&nbsp;<i class="blue"><label>${page.pageNo}</label>&nbsp;</i>页</div>
		<ul class="paginList">
			<%@include file="/static/page/page.html" %>
		</ul>
    </div>  
    
    </div>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
